//
//  HomefansPredictViewController.m
//  LiveStar
//
//  Created by 漪珊 on 2016/12/12.
//  Copyright © 2016年 apple. All rights reserved.
//

#import "HomefansPredictViewController.h"
#import "StarPredictCell.h"
#import "HomeLivingTableView.h"
#import "PredictListModel.h"


@interface HomefansPredictViewController ()
{
    NSMutableArray *_predictArr;
}
@property (nonatomic, strong) HomeLivingTableView *tableView;
@end

@implementation HomefansPredictViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    _predictArr = [NSMutableArray arrayWithCapacity:1];
    [self predictListRequset];
    self.tableView  = [[HomeLivingTableView alloc] initWithFrame:CGRectMake(0, 0, kSCREEN_WIDTH, kSCREEN_HEIGHT - kNAV_HEIGHT - 40)];
    [self.view addSubview:self.tableView];
}

//预播列表
- (void)predictListRequset {
    NSDictionary *dict = @{
                           @"udid":User_ID,
                           @"token":TOKEN,
                           @"page":@"1"
                           };
    NSString *urlString = [TEST_URL stringByAppendingString:kPredictList];
    [NetworkTools postReqeustWithParams:dict UrlString:urlString successBlock:^(id responseObject) {
        NSArray *array = responseObject[@"data"];
        for (NSDictionary *dic in array) {
            PredictListModel *predictModel = [[PredictListModel alloc] initWithDict:dic];
            [_predictArr addObject:predictModel];
        }
        self.tableView.dataArr = _predictArr;
        [self.tableView reloadData];
        self.tableView.contentSize = CGSizeMake(kSCREEN_WIDTH, _predictArr.count * 115 + 49);
    } failureBlock:^(NSError *error) {
        
    } showHUD:NO];
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
